﻿@model Admin.Models.EditUserViewModel

@{
    ViewBag.Title = "编辑";
}


<div class="row">
    <div class="col-lg-6 col-sm-6 col-xs-12">
        <div class="widget radius-bordered">
            <div class="widget-header">
                <span class="widget-caption">编辑用户</span>
            </div>
            <div class="widget-body">
@using (Html.BeginForm("Edit", "UsersAdmin", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
{
    @Html.AntiForgeryToken()
    @Html.HiddenFor(model => model.Id)
    <div class="form-group">
        <label class="col-lg-4 control-label">@Html.LabelFor(m => m.Email)</label>
        <div class="col-lg-8">
            @Html.TextBoxFor(m => m.Email, new { @class = "form-control" })
            @Html.ValidationMessageFor(model => model.Email, "", new { @class = "text-danger" })
        </div>
    </div>

    <div class="form-group">
        <label class="col-lg-4 control-label">@Html.LabelFor(m => m.UserName)</label>
        <div class="col-lg-8">
            @Html.TextBoxFor(m => m.UserName, new {@class = "form-control"})
            @Html.ValidationMessageFor(model => model.UserName, "", new {@class = "text-danger"})
        </div>
    </div>

    <div class="form-group">
        <label class="col-lg-4 control-label"> 用户管理组</label>
        <div class="col-lg-8">
            @foreach (var item in Model.RolesList)
            {
                <div class="checkbox">
                    <label>
                        <input type="checkbox" name="SelectedRole" value="@item.Value" checked="@item.Selected" />
                        <span class="text">@item.Value</span>
                    </label>
                </div>
            }
        </div>
    </div>
    <div class="form-group">
        <div class="col-lg-offset-4 col-lg-8">
            <input type="submit" class="btn btn-default" value="保存" />
            <a class="btn btn-default" id="editabledatatable_new" href="@Url.Action("Index", "UsersAdmin")">
                返回列表
            </a>
        </div>
    </div>
}
            </div>
        </div>
    </div>
</div>
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
<script>
    $(".sidebar-menu li").removeClass("active");
    $("#user").addClass("active");
</script>
